<section class="content-header">
  <!-- <h1>
        我的考勤
    </h1> -->
  <ol class="breadcrumb">
    <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
    <li><a class="active">我的考勤</a></li>
  </ol>
</section>
<section class="content">
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">查询条件</h3>
      <div class="box-tools">
        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
          </button>
        </div>
      </div>
    </div>
    <div class="box-body">
      <div class="row">
        <div class="col-md-3">
          <div class="form-group">
            <label>单据类型</label>
            <select class="form-control select2" name="type" ng-model="search.type">
              <option value="">全部</option>
              <option value="11">病假</option>
              <option value="12">事假</option>
              <option value="13">婚假</option>
              <option value="14">丧假</option>
              <option value="15">产假</option>
              <option value="16">陪产假</option>
              <option value="20">年假</option>
            </select>
          </div>
        </div>
        <div class="col-md-3">
          <div class="form-group">
            <label>审批状态</label>
            <select class="form-control select2" name="status" ng-model="search.status">
              <option value="">全部</option>
              <option value="0">待审批</option>
              <option value="1">通过</option>
              <option value="2">驳回</option>
              <option value="-1">作废</option>
            </select>
          </div>
        </div>
        <div class="col-md-3">
          <div class="form-group">
            <label>开始时间</label>
            <input type="text" class="form-control date-input" id="start_time" ng-model="search.start_time" placeholder="申请日期">
          </div>
        </div>
        <div class="col-md-3">
          <div class="form-group">
            <label>结束时间</label>
            <input type="text" class="form-control date-input" id="end_time" ng-model="search.end_time" placeholder="申请日期">
          </div>
        </div>
      </div>
    </div>
    <div class="box-footer">
      <a class="btn btn-sm btn-info btn-flat pull-right" ng-click="query()">查询</a>
    </div>
  </div>
  <div class="box box-danger">
    <div class="box-body table-responsive no-padding">
      <div style="padding: 10px;" ng-if="data.items.length == 0">
        没有查询到请假单据
      </div>
      <table class="table table-hover" ng-if="data.items.length > 0">
        <tbody>
          <tr>
            <th style="width: 10px">#</th>
            <th>姓名</th>
            <th>类别</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>申请日期</th>
            <th>状态</th>
            <th>审批时间</th>
            <th class="opt-col">操作</th>
          </tr>
          <tr ng-repeat="item in data.items">
            <td ng-bind="($index+1)+'.'"></td>
            <td ng-bind="user.name" ng-attr-title="{{user.name}}"></td>
            <td ng-bind="getType(item.type)"></td>
            <td ng-bind="format(item.date_start, 'YYYY-MM-DD HH:mm')"></td>
            <td ng-bind="format(item.date_end, 'YYYY-MM-DD HH:mm')"></td>
            <td ng-bind="format(item.date_created, 'YYYY-MM-DD')"></td>
            <td ng-bind="getStatus(item.status)"></td>
            <td ng-bind="format(item.date_review, 'YYYY-MM-DD')"></td>
            <td class="opt-col">
              <a href="javascript:;" ui-sref="my_leave_view({id: item.id})"> 详情</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</section>
